<div id="advices" class="sale_view">
	<div id="title">销售结算单-按月份</div>
	<div id="general">
		<div class="info" id="date">结算日期<strong><?php echo date('Y年m月', $advice['general']['advice_date']); ?></strong></div>
		<div class="clear"></div>
		<div class="info" id="sale_quantity">销售总数<strong><?php echo $advice['general']['sale_quantity'] ?>件</strong></div>
		<div class="info" id="return_quantity">销售退货总数<strong><?php echo $advice['general']['return_quantity'] ?>件</strong></div>
		<div class="info" id="real_quantity">实际销售数量<strong><?php echo $advice['general']['sale_quantity'] - $advice['general']['return_quantity'] ?>件</strong></div>
		<div class="clear"></div>
		<div class="info" id="sale_value">销售货物成本<strong><?php echo $advice['general']['sale_value'] ?>￥</strong></div>
		<div class="info" id="return_value">销售退货成本<strong><?php echo $advice['general']['return_value'] ?>￥</strong></div>
		<div class="info" id="real_value">实际销售成本<strong><?php echo $advice['general']['sale_value'] - $advice['general']['return_value'] ?>￥</strong></div>
		<div class="clear"></div>
		<div class="hd">
			<div class="item">货物信息</div>
			<div class="attribute">属性</div>
			<div class="price">成本单价</div>
			<div class="sale_quantity">销售数量</div>
			<div class="return_quantity">退货数量</div>
		</div>
	</div>
	<div id="details">
		<?php foreach($advice['details'] as $key=>$val){ ?>
		<div class="main_goods">
			<div class="main_image">
				<img src="<?php echo $val['info']['image'] ?>" />
				<div class="number-code">
					<div>货号<br /><span><?php echo $val['info']['number'] ?></span></div>
					<div>厂家编号<br /><span><?php echo $val['info']['search_code'] ?></span></div>
					<div class="real_sale_quantity">实际销售 <span>-</span>件</div>
				</div>
			</div>
			<div class="sub_goods">
				<?php foreach($val['sub'] as $k=>$v){ ?>
				<div class="each_sub_goods">
					<div class="attr"><?php echo $v['info']['attribute']; ?></div>
					<div class="price"><?php echo $v['price'] ?>￥</div>
					<div class="sale_quantity"><?php echo $v['sale_quantity'] ?></div>
					<div class="return_quantity"><?php echo $v['return_quantity'] ?></div>
					<div class="store_quantity">
						<div class="col">
							<div class="store">仓库</div>
							<div class="sale_quantity">销售</div>
							<div class="return_quantity">退货</div>
						</div>
						<?php foreach ($v['stock'] as $store_id=>$quantity) { ?>
						<div class="col">
							<div class="store"><?php echo $store_id; ?></div>
							<div class="sale_quantity"><?php echo $quantity['sale_quantity'] ?></div>
							<div class="return_quantity"><?php echo $quantity['return_quantity'] ?></div>
						</div>
						<?php } ?>
						<div class="clear"></div>
					</div>
				</div>
				<?php } ?>
			</div>
			<div class="clear"></div>
		</div>
		<?php } ?>
	</div>
</div>
<script type="text/javascript">
$(function(){
	//格式化
	advice.init();
	advice.sale.view.init();
});
</script>
<?PHP //var_dump($advice) ?>